SA

[Encerrado] [Pedido] Bike System

Por Sakura777, 28 de out. de 2012 em Tópicos Sem Resposta

pedido
script
19
2.4k
Sakura777S
28 de outubro de 2012 às 12:46

Será que alguém pode fazer 1 detalhe para mim com essa script de bike? tipo quero que possam usa ela apenas quando ela estiver no slot na pokebag, porque ela se jogar no chão e varios clicarem todos ficam montado na bike :\ agradeço quem conseguir fazer isso para mim

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

SlicerS
28 de outubro de 2012 às 13:01

ta eh um item normal? q tem q ficar dentro da bag? ou ele VAI no lugar da bag?

Sakura777S
28 de outubro de 2012 às 13:22

ta eh um item normal? q tem q ficar dentro da bag? ou ele VAI no lugar da bag?

 

Não ele vai fica dentro da bag, exemplo eu fiz 1 slot sepossivel eu quero que ela só funcione se eu por ela no local exemplo

 

 

97994387.png

 

 

 

no slot acima do cap, é onde eu ponho a bike, porem ela usa em qualquer luga se joga no chão e da use ja monta na bike, se possivel quero ajdua de alguem que faça ela pode ser usada só se por no slot acima do cap ali, ou se por dentro da pokepag.

Session StartS
28 de outubro de 2012 às 14:31

tenta colocar isso

PEGA DNV, tava slot errado '-'

 

 

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

Editado Outubro 28 por Cleberadm

Sakura777S
28 de outubro de 2012 às 14:55

tenta colocar isso

PEGA DNV, tava slot errado '-'

 

 

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

 

Malz tipo, continua quase a mesma coisa exemplo, essa bike script está configurada para quest bike, quando o player pega a bike ela via para 1 slot, mas tipo, se o player joga a bike no chão e clica monta na bike, no caso eu iria querer por a bike para vender no shop quando ela chega na bag se o player joga no chão e tenta clicar vai falar, precisa esta no slot correto para usa a bike. Sendo que a unica solução que tive foi na quest só pega a bike se o slot estive vazio e deixei ela imovel quando ela cai no slot ja era nao tem ais como remove, ams ano quero deixa ela como quest quero vende no shope o player fazer negocios com a bike e esse tipo de coisa, fazer oque ele bem entender.,desde que nao dê pra usa ela no chão e monte de player clica e sair usando bike por ae¬¬. se puder me ajuda fico grata T_____T Leva +rep pq ano quebra dedo

Session StartS
28 de outubro de 2012 às 15:01

Não tem como eu testar aqui, mas vamo tentanto '-'

 

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

Sakura777S
28 de outubro de 2012 às 15:08

Não tem como eu testar aqui, mas vamo tentanto '-'

 

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.uid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

Agora ela não da use em lugar nenhum. T_____________T

Session StartS
28 de outubro de 2012 às 15:13

Coloquei agora itemid / era uid e,e

 

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.itemid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

Sakura777S
28 de outubro de 2012 às 15:17

Coloquei agora itemid / era uid e,e

 

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == sBike.itemid then

doPlayerSendCancel("Não está no slot correto")

return true

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

O problema persistiu D::D:: T___T nao da use em nenhum lugar

 

Edit: QUando da use

 

[28/10/2012 14:17:08] [Error - Action Interface]

[28/10/2012 14:17:08] data/actions/scripts/Bike.lua:onUse

[28/10/2012 14:17:08] Description:

[28/10/2012 14:17:08] data/actions/scripts/Bike.lua:31: attempt to index local 'sBike' (a number value)

[28/10/2012 14:17:08] stack traceback:

[28/10/2012 14:17:08] data/actions/scripts/Bike.lua:31: in function <data/actions/scripts/Bike.lua:1>

Editado Outubro 28 por Sakura777

Session StartS
28 de outubro de 2012 às 15:20

Só uma pergunta, aquele 5247 é o ID da bike? G.G

 

Ou é storage?

Editado Outubro 28 por Cleberadm

Sakura777S
28 de outubro de 2012 às 15:28

Só uma pergunta, aquele 5247 é o ID da bike? G.G

 

Ou é storage?

 

 

[2547] ID da bike

Session StartS
28 de outubro de 2012 às 15:40

A mano, já vi, eu pus pra usar no lugar do colar, pensei que AMMO éra emcima do cap o.O vou ver se acho o nome certo daquilo g,g

SlicerS
28 de outubro de 2012 às 16:44

ta ae...

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, 10).uid ~= item.uid then

return doPlayerSendCancel(cid, "You have to put the bike in the correct slot!")

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

@Cleberadm

vc tinha feito certo.. soh q tu boto para caso a bike estivese no slot de ammo mandase a msg q esta no lugar errado ;x

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

deveria ser..

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid ~= item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

Sakura777S
28 de outubro de 2012 às 16:49

ta ae...

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local sBike = 2547

local t = {

[2547] = {article='a', name='bike', text='', dtext='', s=5700, condition=bikeCondition},

}

function BikeSpeedOn(cid,nSpeed)

setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,nSpeed)

end

function BikeSpeedOff(cid)

doChangeSpeed(cid,-getCreatureSpeed(cid))

doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))

end

 

local v, r = getCreaturePosition(cid), t[item.itemid]

local s = r.s

local pos = {x = v.x, y = v.y, z = v.z}

if r then

if getPlayerStorageValue(cid, 25000) == 5 then

return

end

if getPlayerStorageValue(cid, 23000) == 5 then

return

end

 

if getPlayerStorageValue(cid, 17001) == 1 or getPlayerStorageValue(cid, 63215) == 1 or getPlayerStorageValue(cid, 17000) == 1 then

doPlayerSendCancel(cid, "You can't use bike while ride/fly/surf.")

return true

end

if getPlayerSlotItem(cid, 10).uid ~= item.uid then

return doPlayerSendCancel(cid, "You have to put the bike in the correct slot!")

end

if getPlayerStorageValue(cid, s) <= 0 then

doCreatureSay(cid, r.text, 19)

setPlayerStorageValue(cid, s, 1)

BikeSpeedOn(cid,1250)

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1394, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1393, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)

end

 

elseif getPlayerStorageValue(cid, s) == 1 then

doCreatureSay(cid, r.dtext, 19)

setPlayerStorageValue(cid, s, 0)

BikeSpeedOff(cid)

return doRemoveCondition(cid, CONDITION_OUTFIT)

else

return doPlayerSendCancel(cid, 'You can\'t do this.')

end

else

return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')

end

end

 

 

@Cleberadm

vc tinha feito certo.. soh q tu boto para caso a bike estivese no slot de ammo mandase a msg q esta no lugar errado ;x

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid == item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

deveria ser..

if getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid ~= item.uid then
doPlayerSendCancel("Não está no slot correto")
return true
end

 

 

@Slicer *----------------------* Muito obrigado muito mesmo leva + rep essa foi perfeita

 

@Cleberadm: Muito obrigado por tenta me ajuda foi quase la

Session StartS
28 de outubro de 2012 às 16:55

Que isso UHSUASHA to aprendendo também ^~~. reportei pra moreverem